<template>
  <div>
    <van-nav-bar
      :title="title"
    >
      <template #left>
        <van-icon
          @click="onClickLeft"
          name="arrow-left"
          color="#999"
        />
        <slot name="title" />
      </template>
      <template #right>
        <slot />
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  name: 'NavBar',
  props: {
    title: {
      type: String,
      default: '',
    },
  },
  data() {
    return {

    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
  },
}
</script>

<style>
</style>
